﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;

namespace Financial
{
    class NewsHandler
    {
        public NewsHandler() {}

        public static String GetNews(String searchTerm)
        {
            HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(
                                "http://news.search.yahoo.com/rss?ei=UTF-8&p=" + searchTerm + "&fr=news-us-ss");
            HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
            StreamReader strm = new StreamReader(webresp.GetResponseStream(), Encoding.UTF8);
            return strm.ReadToEnd();
        }
    }
}
